<template>
	<div>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-icon mui-icon-left-nav" @click="goBack"></a>
			<h1 class="mui-title">{{ title }}</h1>
			<a class="mui-icon mui-icon-more-filled mui-pull-right menuShow" v-if="menuShow"></a>
		</header>
	</div>
</template>

<script>
	export default {
		data () {
			return {
				menuShow: false
//				showRight : false页面呢
			}
		},
		created () {
			let self = this;
			Event.$on('menuShow', target => {
				self.menuShow = target;
			})
		},
		methods: {
			goBack () {
				if(window.ReturnFromH5) {
					return window.ReturnFromH5.ComeBack();
				} else if(window.browseHistory) {
					window.browseHistory.historyBack();
				} else {
					history.back();
				}
			}
		},
		props: [ 'title' ]
	}
</script>